package org.hotelsystem.hoteladminsystem.Controller;

import org.hotelsystem.hoteladminsystem.Service.HotelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RestController
@RequestMapping("/hotel")
public class HotelController {

    @Autowired
    private HotelService hotelService;
    // 添加酒店信息
    // 删除酒店信息
    // 修改酒店信息
    // 查询酒店信息
    @GetMapping("/getallhotels")
    public Map<String, Object> getAllHotels() {
        return hotelService.getAllHotelsData();
    }

    @GetMapping("/gethotelbyid")
    public Map<String, Object> getHotelById(@RequestParam(value = "id", required = true) int id) {
        return hotelService.getHotelDataByID(id);
    }
    // 显示酒店信息
}
